<extend name="Public/base"/>
<block name="content">
<h3 class="col-md-8">导航管理</h3>
<div class="row">
    <div class="col-lg-12">
    	<div class="panel panel-default">
       		<div class="panel-heading ">导航列表
       			<div class="btn-group pull-right">
	         		<a class="btn btn-labeled btn-success " href="<{:U('add')}>">新 增</a>
					<a class="btn btn-labeled btn-danger" href="javascript:;">删 除</a>
					<button class="btn btn-labeled btn-success list_sort" url="<{:U('sort',array('pid'=>I('get.pid',0)),'')}>">排序</button>
	         	
	         	</div>      			
       		</div>
    		<div class="table-responsive">
    		<table class="table table-striped table-bordered table-hover">    
                    <thead>
                      	<tr>
                        	<th style="width: 5%" class="check-all">
                          		<div data-toggle="tooltip" data-title="全选" class="checkbox c-checkbox">
                             		<label>
                                		<input type="checkbox">
                                		<span class="fa fa-check"></span>
                             		</label>
                          		</div>
                       		</th> 
                        	<th>ID</th>
        					<th>导航名称</th>
        					<th>上级导航</th>
        					<th>导航地址</th>
        					<th>导航排序</th>
                     		<th>添加时间</th>
                     		<th class='text-center'>操作</th>
                      	</tr>
                    </thead>
                    <tbody>
                    	<notempty name="list">
                    	<volist name="list" id="data" key="k">
                      	<tr>
                        	<td>
                          		<div class="checkbox c-checkbox">
                             		<label>
                                	<input class="ids row-selected"  type="checkbox" value="<{$data.id}>" name="id[]">
                                	<span class="fa fa-check"></span>
                             		</label>
                          		</div>
                       		</td>			
        					<td><{$data.id}></td>
        					<td class='m-name'><{$data.title}></td>
        					<td><{$data.pid|get_channel_name}></td>
        					<td><{$data.url}></td>
        					<td><{$data.sort}></td>
                        	<td><{$data.create_time|time_format='Y-m-d'}></td>
                        	<td class='text-center'>
                        		<a class="btn btn-labeled btn-sm " href="<{:U('edit?id='.$data['id'])}>"><em class="fa fa-edit"></em></a>
	                            <a class="btn btn-labeled btn-sm " href="<{:U('del?id='.$data['id'])}>"><em class="fa fa-times"></em></a>
                        	</td>
                      	</tr>
                      	</volist>
        				<else/>
        				<td colspan="10" class="text-center">暂时还没有内容! </td>
        				</notempty>
                    </tbody>
                </table>
    		</div>
    		<!-- 结束 表格 -->
    		<div class="panel-footer">
    			<div class="row">
					<ul class="pagination">
					<{$_page}>
					</ul>
				 </div>
            </div>    		
    	</div>
	</div>
</div>
</block>
<block name="script">
<script type="text/javascript">
		highlight_subnav("<{:U('Config/group')}>","<{:U('Channel/index')}>");
	    $(function() {
    	//点击排序
    	$('.list_sort').click(function(){
    		var url = $(this).attr('url');
    		var ids = $('.ids:checked');
    		var param = '';
    		if(ids.length > 0){
    			var str = new Array();
    			ids.each(function(){
    				str.push($(this).val());
    			});
    			param = str.join(',');
    		}

    		if(url != undefined && url != ''){
    			window.location.href = url + '/ids/' + param;
    		}
    	});
    });
</script>
</block>	


